﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace SEBanking
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (Session["UserName"].ToString() == String.Empty)
                Response.Redirect("~/Index.aspx");

            DataClassesSEBankingDataContext context = new DataClassesSEBankingDataContext();
            var query = from a in context.SEBanking_Accounts
                        from c in context.SEBanking_Cards
                        where a.Acc_ID == Session["UserID"].ToString() && a.Acc_ID == c.Acc_ID
                        select new { AccID = a.Acc_ID, AccName = a.Acc_Name, AccEmail = a.Acc_Mail, CardID = c.Card_ID, SecurityCode = c.Card_SecurityCode };
            foreach (var q in query)
            {
                lblAccountID.Text = q.AccID;
                lblName.Text = q.AccName;
                lblEmail.Text = q.AccEmail;
                lblCardID.Text = q.CardID;
                lblSecurityID.Text = q.SecurityCode;
            }
        }
    }
}
